var express = require('express');
var router = express.Router();
const shsDB = require("./../../db/index.js");
const {
	comSensitiveWords
} = require("./../../utils/sensitive.js");

// 处理请求
router.post("/handle", async function(req, res) {
	let contentText = req.body.value;
	if (!contentText) {
		res.send(JSON.stringify({
			status: false,
			highlightedText: "",
			code: 400,
			message: "参数不合法"
		}));
		return;
	}
	let result =await comSensitiveWords(contentText);
	res.send(JSON.stringify(result));

});

module.exports = router;